/**
 * All rights Reserved, Designed By 溪云阁
 * Copyright:    Copyright(C) 2016-2020
 */

package com.boots.submit.view.submit.view;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.module.boots.api.message.ResponseMsg;
import com.module.boots.api.utils.MsgUtils;
import com.module.boots.exception.CommonRuntimeException;
import com.module.boots.submit.NoRepeatSubmit;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;

/**
 * @author：溪云阁
 * @date：2020年5月24日
 */
@SuppressWarnings("deprecation")
@Api(tags = { "WEB服务：数据接口" })
@RestController
@RequestMapping("web/submit")
public class SubmitController {

    /**
     * 获取字符串信息
     * @author 溪云阁
     * @param id
     * @param name
     * @return ResponseMsg<JSONObject>
     */
    @ApiOperation(value = "获取字符串信息")
    @GetMapping(value = "/getString", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    @NoRepeatSubmit
    @SneakyThrows(CommonRuntimeException.class)
    public ResponseMsg<Map<String,Object>> getString(@RequestParam("id") String id, @RequestParam("name") String name) {
        final Map<String,Object> json = new ConcurrentHashMap<>();
        json.put("id", id);
        json.put("name", name);
        return MsgUtils.buildSuccessMsg(json);
    }

}
